import 'package:flutter_test/flutter_test.dart';
import 'package:kb_bytedance_attribution/kb_bytedance_attribution.dart';
import 'package:kb_bytedance_attribution/kb_bytedance_attribution_platform_interface.dart';
import 'package:kb_bytedance_attribution/kb_bytedance_attribution_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockKbBytedanceAttributionPlatform
    with MockPlatformInterfaceMixin
    implements KbBytedanceAttributionPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> convertInit() {
    // TODO: implement convertInit
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEnableIdfa({required bool enable}) {
    // TODO: implement iOSEnableIdfa
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEventCustom({required String eventName, Map<String, dynamic>? params}) {
    // TODO: implement iOSEventCustom
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEventGameAddiction({Map<String, dynamic>? params}) {
    // TODO: implement iOSEventGameAddiction
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEventPurchase({Map<String, dynamic>? params}) {
    // TODO: implement iOSEventPurchase
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEventRegister({Map<String, dynamic>? params}) {
    // TODO: implement iOSEventRegister
    throw UnimplementedError();
  }

  @override
  Future<void> iOSEventStayTime({Map<String, dynamic>? params}) {
    // TODO: implement iOSEventStayTime
    throw UnimplementedError();
  }

  @override
  Future<String?> iOSGetClickId() {
    // TODO: implement iOSGetClickId
    throw UnimplementedError();
  }

  @override
  Future<void> iOSRegisterWithOptionalData({String? userUniqueId}) {
    // TODO: implement iOSRegisterWithOptionalData
    throw UnimplementedError();
  }

  @override
  Future<void> onEventPurchase({required String contentType, required String contentName, required String contentId, required int contentNumber, required String paymentChannel, required String currency, required bool isSuccess, required int currencyAmount}) {
    // TODO: implement onEventPurchase
    throw UnimplementedError();
  }

  @override
  Future<void> onEventRegister({required String registerMethod, required bool isSuccess}) {
    // TODO: implement onEventRegister
    throw UnimplementedError();
  }

  @override
  Future<void> onEventV3({required String eventName, required Map<String, dynamic> extraParams}) {
    // TODO: implement onEventV3
    throw UnimplementedError();
  }

  @override
  Future<void> sendLaunchEvent() {
    // TODO: implement sendLaunchEvent
    throw UnimplementedError();
  }
}

void main() {
  final KbBytedanceAttributionPlatform initialPlatform = KbBytedanceAttributionPlatform.instance;

  test('$MethodChannelKbBytedanceAttribution is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelKbBytedanceAttribution>());
  });

  test('getPlatformVersion', () async {
    KbBytedanceAttribution kbBytedanceAttributionPlugin = KbBytedanceAttribution();
    MockKbBytedanceAttributionPlatform fakePlatform = MockKbBytedanceAttributionPlatform();
    KbBytedanceAttributionPlatform.instance = fakePlatform;

    expect(await kbBytedanceAttributionPlugin.getPlatformVersion(), '42');
  });
}
